import {NodeA,ASTree} from './arktsAST';
import {CFG,statement} from './cfg';
import {Edge,Graph} from './graph';
import {FDT} from './fdt';
import {CDG,CDGGEN} from './cdg';
import * as fs from 'fs';

// let fileContent = fs.readFileSync(process.cwd() + '/src/testfile.ts', 'utf8');
// let ast:ASTree=new ASTree(fileContent);
// ast.buildTree()
// let cfg:CFG=new CFG(ast.root,"testfile");


let graph = new CDGGEN(6,0,5);


graph.addEdge(1,2);graph.addEdge(1,8);graph.addEdge(1,11);graph.addEdge(2,3);graph.addEdge(2,6);graph.addEdge(3,4);
graph.addEdge(4,5);graph.addEdge(5,1);graph.addEdge(5,4);graph.addEdge(6,7);graph.addEdge(6,4);graph.addEdge(7,4);
graph.addEdge(8,11);graph.addEdge(8,12);graph.addEdge(8,9);graph.addEdge(9,10);graph.addEdge(10,9);graph.addEdge(10,5);
graph.addEdge(11,12);graph.addEdge(12,13);graph.addEdge(13,10);

/*
graph.addEdge(0,1);
graph.addEdge(1,2);
graph.addEdge(1,3);
graph.addEdge(2,4);
graph.addEdge(3,4);
graph.addEdge(4,5);
*/
graph.init();
let cdg:CDG = graph.getCDG();
console.log(cdg);
